import instance from '@/utils/axios'

const userLogin = ({phone,password}) => {
  return instance({
    url:'/login/cellphone',
    method:'get',
    params:{phone,password},

  })
}

// 检测手机号是否已经注册
const isPhone = (phone) => {
  return instance({
    url:'/cellphone/existence/check',
    method:'get',
    params:phone
  })
}

// 发送短信验证码
const isCode = (phone) => {
  return instance({
    url:'/captcha/sent',
    method:'get',
    params:phone
  })
}

// 注册
const zhuceUser = ({captcha,phone,password,nickname}) => {
  return instance({
    url:'/register/cellphone',
    method:'get',
    params:{captcha,phone,password,nickname}
  })
}

// 首页 圆形图标入口列表
const ball = () => {
  return instance({
    url:'/homepage/dragon/ball',
    method:'get'
  })
}

export {userLogin,isPhone,isCode,zhuceUser,ball}
